<template>
  <bui-page-layout ref="pageLayout" :is-z-paging="false">
    <view class="member-benefit">
      <u-parse :content="partnerBenefitsContent"></u-parse>
    </view>
    <template v-slot:footer>
      <view class="button-footer">
        <view class="btn" @click="openRoutePath('pages/partner-benefit/records')">
          <text class="t">收益明细</text>
        </view>
        <view class="submit" @click="openRoutePath('pages/partner-benefit/form')">
          <text class="t" v-if="gStore?.userInfo.partnerAuditStatus === 2">重新提交</text>
          <text class="t" v-if="gStore?.userInfo.partnerAuditStatus === 1 || gStore?.userInfo.partnerAuditStatus === 0">查看合伙人信息</text>
          <text class="t" v-if="gStore?.userInfo.partnerAuditStatus === -1">申请成为合伙人</text>
        </view>
      </view>
      <view :style="'height: '+gStore.safeAreaBottom+'px;'"></view>
    </template>
  </bui-page-layout>
</template>
<script setup>
import { ref, computed } from "vue";
import { onLoad, onShow } from "@dcloudio/uni-app";
import { globalStore } from "@/store";
const gStore = globalStore();
var isShare = ref(false);
var safeAreaBottom = ref(0);

const partnerBenefitsContent = ref("");
onLoad((options) => {
  gStore.getUserInfo();
});
const openRoutePath = (path) => {
  uni.$u.route({
    url: path,
  });
};
// partnerBenefits
const getPartnerBenefits = () => {
  uni.$request
    .service({
      url: "/cnt/partnerBenefits",
      method: "POST",
      data: {},
    })
    .then((res) => {
      partnerBenefitsContent.value = res.content;
    });
};
getPartnerBenefits();
onShow(() => {
  gStore.getUserInfo();
});
</script>
<style lang="scss">
page {
  background-color: #f6f6f8;
}
.member-benefit {
  padding: 30rpx;
  line-height: 50rpx;
}
.button-footer {
  display: flex;
  margin: 20rpx 40rpx;
  .btn {
    border-radius: 16rpx;
    border: 1px solid #fe9900;
    background: #fff;
    padding: 22rpx 34rpx;
    font-size: 32rpx;
    font-style: normal;
    font-weight: 500;
    color: #fe9900;
    line-height: normal;
    margin-right: 20rpx;
    box-shadow: 0px 0px 40rpx 0px rgba(0, 0, 0, 0.15);
  }
  .submit {
    flex: 1;
    background-color: #fe9900;
    display: flex;
    justify-content: center;
    border-radius: 16rpx;
    padding: 22rpx 0;
    font-style: normal;
    font-weight: 500;
    box-shadow: 0px 0px 40rpx 0px rgba(0, 0, 0, 0.15);
    .t {
      font-size: 32rpx;
      color: #fff;
    }
  }
}
</style>
